<html>
   <head>
      <script type="text/javascript">
         window.onload = function() {

            var wsuri = "ws://localhost:9000";

            if ("WebSocket" in window) {
               webSocket = new WebSocket(wsuri);
            }
            else {
               // Firefox currently prefixes the WebSocket object
               webSocket = new MozWebSocket(wsuri);
            }

            webSocket.onmessage = function(e) {
               alert("Got echo: " + e.data);
            }
         }

         function send() {
            webSocket.send(document.getElementById("message").value);
         }
      </script>
   </head>
   <body>
      <h1>Autobahn WebSocket Echo Test</h1>
      <form>
         <p>Message: <input id="message" type="text" size="50" maxlength="50" value="Hello, world!"></p>
      </form>
      <button onclick='send();'>Send</button>
   </body>
</html>
